package iconSwingStates.Transitions.TransitionOnTag;

/**
 * TLeaveOnTAg is declenched when a pointer comes out of a shape with a given tag.
 * This transition doesn't need a name because it is not visible in the ICon Configurator.
 * @author uribe-gaget
 *
 */
public class TLeaveOnTag extends TMoveOnTag{
	/**
	 * Default constructor when there is no need of additional slots and when the output state is different from the input state
	 * @param pointer The pointer used to get the position datas
	 * @param tag The tag
	 * @param outputState The output state
	 */
	public TLeaveOnTag(String pointer, String tag,
			String outputState) {
		super("leaveOnTag."+tag,pointer, tag, outputState);
	}
	/**
	 * Default constructor when there is no need of additional slots and when the output state is different from the input state
	 * @param pointer The pointer used to get the position datas
	 * @param tag The tag
	 */
	public TLeaveOnTag(String pointer, String tag) {
		super("leaveOnTag."+tag,pointer, tag);
	}
	/**
	 * Default constructor when there is no need of additional slots and when the output state is the same as the input state
	 * @param pointer The pointer used to get the position datas
	 * @param type Types of the slots attached to the transition
	 * @param obligatory If the additional slots must be connected or not
	 * @param synchro If the additional slots must all be active in the same time to fire the transition
	 * @param tag The tag
	 */
	public TLeaveOnTag(String pointer,int[] type, boolean obligatory,boolean synchro, String tag) {
		super("leaveOnTag."+tag,pointer,type, obligatory,synchro,tag);
	}
	/**
	 * Default constructor when there is no need of additional slots and when the output state is different from the input state
	 * @param pointer The pointer used to get the position datas
	 * @param type Types of the slots attached to the transition
	 * @param obligatory If the additional slots must be connected or not
	 * @param synchro If the additional slots must all be active in the same time to fire the transition
	 * @param tag The tag
	 * @param outputState The output state
	 */
	public TLeaveOnTag(String pointer,int[] type, boolean obligatory,boolean synchro, String tag,String outputState) {
		super("leaveOnTag."+tag,pointer,type, obligatory,synchro,tag,outputState);
	}

	
	public boolean equals(Object obj) {
		if(obj instanceof TLeaveOnTag){
			TLeaveOnTag tr = (TLeaveOnTag)obj;
			if(tr.getName().compareTo(this.getName()) == 0 && getInputState().getName().compareTo(tr.getInputState().getName()) == 0 && getTag().equals(tr.getTag())){
				return true;
			}
			
		}
		return false;
	}
	
}